package main

import (
	"fmt"
)

func testMake1()  {
	a := make([]int,5,10)
	a[0]=10
	a[1]=20
	fmt.Printf("a=%v\n",a)
	
}
func testCap()  {
	a := [...]string{"a","b","c","d","e","f","g","h"}
	b := a[1:3]
	fmt.Printf("b:%v len:%d cap:%d\n",b,len(b),cap(b))
	
}
func testCap2()  {
	a := [...]string{"a","b","c","d","e","f","g","h"}
	b := a[1:3]
	fmt.Printf("b:%v len:%d cap:%d\n",b,len(b),cap(b))
	b = b[:cap(b)]
	fmt.Printf("after reslice:b:%v len:%d cap:%d\n",b,len(b),cap(b))
	
}
func main()  {
	testCap2()
	
}